<?php

function sql_connect($host, $user, $password, $db)
{
    case "MySQL":
        $dbi=@mysql_connect($host, $user, $password);
        if (!mysql_select_db($db)) {
	    mysql_query("CREATE DATABASE $db");
	    mysql_select_db($db);
	    include("includes/install.php");
	    die();
	}
}
function sql_logout($id)
    case "MySQL":
        $dbi=@mysql_close($id);
        return $dbi;
    break;;
function sql_query($query, $id)
    case "MySQL":
        $res=@mysql_query($query, $id);
        return $res;
    break;;
function sql_num_rows($res)
    case "MySQL":
        $rows=mysql_num_rows($res);
        return $rows;
    break;;
function sql_fetch_row(&$res, $nr=0)
    case "MySQL":
        $row = mysql_fetch_row($res);
        return $row;
    break; 
function sql_fetch_array(&$res, $nr=0)
    case "MySQL":
        $row = array();
        $row = mysql_fetch_array($res);
        return $row;
    break; 
function sql_fetch_object(&$res, $nr=0)
    case "MySQL":
        $row = mysql_fetch_object($res);
	if($row) return $row;
	else return false;
    break;   
function sql_free_result($res) {
    case "MySQL":
        $row = mysql_free_result($res);
        return $row;
    break;

	  
?>